<!-- 
 - AdministratorHomepage.php
 - v2.0
 - 3/14/2011
 - 
 - This file presents the user interface for the administrator. 
 -->
<?php 
	require 'libraries/ViewAnalysisLib.php';
	require 'libraries/GetClientLib.php';
	require 'libraries/UserLibrary.php';
	require 'libraries/CreateReportLib.php';
	
	isSessionSet("administrator", null, "Logout.php");	
?>
<html>
	<head>
		<title>CASLIMS | View Samples</title>
		<script type="text/javascript" src="scripts/validateAnalyst.js"></script>
		<link rel="stylesheet" type="text/css" href="scripts/page.css"/>
		<link href="tools/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
	</head>
	<body>
		<form method="post" action="ProcessViewSamples.php?key=<?php echo $_GET['sample_key'];?>">
			<div id="header"></div>
			<div id="wrapper">
				<div id="pagetop">
					<div class="greeting">Hi, <?php echo $_SESSION["administrator"];?> | <a href="Logout.php">Log out</a> | <a href="AdministratorHomepage.php"> Home </a></div>
					<div class="homepage"><?php echo $_SESSION["administrator"];?></div>
				</div>
			<table>
				<thead>
				<tr>
					<th>CASL Number</th>
					<th>Analysis Required</th>
					<th>Status</th>
					<th>Unit</th>
				</tr>
				</thead>
				<?php 
				$samples = getAllSamples($_GET['sample_key'],'casl','localhost','login','login');
				for($i = 0; $i < count($samples); $i++){
					
					echo "<tr>";
					printf("<td>%s-%04d</td>",$samples[$i]['casl_no_year'],$samples[$i]['casl_no_sample']);
					echo "<td>".$samples[$i]['analysis_required']."</td>";
					echo "<td>".$samples[$i]['status']."</td>";
					$value = GetUnit($samples[$i]['casl_no_year'], $samples[$i]['casl_no_sample'], "casl", "localhost", "editanalysis", "editanalysis");
					echo "<td><input type='textbox' name='unit[]' value=".$value."></td>";
					echo "</tr>";
				}
			
				?>
			</table>
			<div id="buttons">
				<input type="button" value="Back To Homepage" onClick='document.location.href = "AdministratorHomepage.php"'>
				<input type="submit" value="Update Units"/>
			</div>	
			<div id="footerwrap">
				<div id="footer"> 
					<div class="copyright">Copyright 2011.<a>CASL BIOTECH-UPLB.</a> All Rights Reserved.<br/> 
				Arianne Buse&ntilde;os | Darlene Joy Masong | Rick Jason Obrero | Jonathan Pandi | Jonathan Simbahan | Emmanuel Soriano 
					</div> 
	    	    </div>
			</div>				
		</div>
		</form>		
	</body>
</html>
